﻿using Sys.Core.Gen;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AdvButton : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public string ButtonAdv()
    {
        var model = FocuBll.I.SortEntities.FirstOrDefault(m => m.Group.Equals("ButtonAdv") && m.IsVisible);

        System.Text.StringBuilder sb = new System.Text.StringBuilder();

        if (model != null)
        {
            sb.Append("<p><a href='" + (string.IsNullOrEmpty(model.Link) ? "javascript:void(0)" : model.Link) + "' target='_blank'><img src='userfiles/focu/" + model.Img + "' /></a></p>");
        }
        else
        {
            sb.Append("<p><a href='javascript:void(0)'><img width='1000' height='100' src='userfiles/focu/null.png' /></a></p>");
        }

        return sb.ToString();
    }
}